package com.example.liuke.guangguang.adapter;

import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.liuke.guangguang.R;
import com.example.liuke.guangguang.bean.AppInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by liuke on 2018/11/29.
 */

public class ApplistAdapter  extends BaseQuickAdapter<AppInfo, BaseViewHolder> {

    private Context mContext;
    private List<AppInfo> mydate = new ArrayList<>();
    private int length;

    public ApplistAdapter(Context context, @LayoutRes int layoutResId, @Nullable List<AppInfo> data) {
        super(layoutResId, data);
        mContext = context;
        mydate = data;
        this.length = length;
    }

     // helper.getView(R.id.book).setVisibility(View.VISIBLE);
    //   helper.setText(R.id.bookimage,"");
    @Override
    protected void convert(BaseViewHolder helper, AppInfo commentData) {
        ImageView imageView = helper.getView(R.id.appicon);
        imageView.setImageDrawable(commentData.getAppIcon());
       // Glide.with(mContext).load(commentData.getAppIcon()).into((ImageView) helper.getView(R.id.appicon));
        helper.setText(R.id.appname,commentData.getAppLabel());
    }

}
